package com.wing.cabinet.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * 刀柜
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("cab_cabinet")
public class Cabinet extends BaseEntity<Cabinet> implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(type = IdType.INPUT)
    private Long id;

    public enum Status implements IEnum<Integer> {

        /**
        * 已签收
        */
        receipts(0,"已签收"),
        /**
        * 已分配
        */
        already(1,"已分配"),
        /**
        * 待分配
        */
        wait(2,"待分配"),
        /**
        * 未完善
        */
        notPerfection(3,"未完善"),

        /**
         * 在库
         */
        synced(4,"在库");

        /**
         * 正常
         *//*
        normal(5,"正常"),
        *//**
         * 断电
         *//*
        outage(6,"断电"),
        *//**
         * 故障
         *//*
        fault(7,"故障"),
        *//**
         * 维修中
         *//*
        maintenance(8,"维修中"),
        *//**
         * 报废
         *//*
        scrap(9,"报废");*/
        private int code;
        private String desc;

        Status(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }
    public enum CabinetNature implements IEnum<Integer> {

        /**
         * 主柜
         */
        main(0,"主柜"),
        /**
         * 售刀副柜
         */
        sale(1,"售刀副柜"),
        /**
         * 存刀副柜
         */
        live(2,"存刀副柜");

        private int code;
        private String desc;

        CabinetNature(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum CabStatus implements IEnum<Integer> {

        /**
         * 正常
         */
        normal(0,"正常"),
        /**
         * 故障
         */
        fault(1,"故障"),
        /**
         * 待激活
         */
        noActivated(2,"待激活");

        private int code;
        private String desc;

        CabStatus(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    public enum CabNatureType implements IEnum<Integer> {

        /**
         * 实体
         */
        entity(0,"实体"),
        /**
         * 虚拟
         */
        virtual(1,"虚拟");

        private int code;
        private String desc;

        CabNatureType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 编号
     */
    private String code;

    /**
     * 名称
     */
    private String name;

    /**
     * 入驻企业ID
     */
    private Long settledCompanyId;

    /**
     * 刀柜分类ID
     */
    private Long cabinetCategoryId;

    /**
     * 刀柜类型ID
     */
    private Long cabinetTypeId;

    /**
     * 刀柜型号ID
     */
    private Long cabinetModelId;

    /**
     * 刀柜品牌ID
     */
    private Long cabinetBrandId;

    /**
     * 主板类型ID
     */
    private Long motherboardTypeId;

    /**
     * 控制面板类型ID
     */
    private Long controlTypeId;

    /**
     * 升降主板类型ID
     */
    private Long hostTypeId;

    /**
     * 数量
     */
    private Integer quantity;

    /**
     * 车间位置
     */
    private String workshopLocation;

    /**
     * 库位
     */
    private String seat;

    /**
     * 提交人
     */
    private String submitter;

    /**
     * 楼层
     */
    private String floor;

    /**
     * 刀柜SKU码
     */
    private String cabinetSku;

    /**
     * 状态
     */
    private Status status;

    /**
    * 状态描述
    */
    @TableField(exist = false)
    private String statusDesc;

    public String getStatusDesc() {
        return status == null ? null : status.getDesc();
    }
    /**
     * 刀柜性质
     */
    private CabinetNature cabinetNature;

    /**
     * 刀柜性质描述
     */
    @TableField(exist = false)
    private String cabinetNatureDesc;

    public String getCabinetNatureDesc() {
        return cabinetNature == null ? null : cabinetNature.getDesc();
    }

    /**
     * 所属主柜编码
     */
    private String belongCabinet;

    /**
     * 刀柜自定义编码
     */
    private String customizeCabCode;

    /**
     * 刀柜状态
     */
    private CabStatus cabStatus;

    /**
     * 刀柜状态描述
     */
    @TableField(exist = false)
    private String cabStatusDesc;

    public String getCabStatusDesc() {
        return cabStatus == null ? null : cabStatus.getDesc();
    }

    /**
     * 刀柜性质状态
     */
    private CabNatureType cabNatureType;

    /**
     * 刀柜性质状态描述
     */
    @TableField(exist = false)
    private String cabNatureTypeDesc;

    public String getCabNatureTypeDesc() {
        return cabNatureType == null ? null : cabNatureType.getDesc();
    }

    /**
     * 序号
     */
    public Integer serialNumber;
    /**
     * 货道数量
     */
    @TableField(exist = false)
    private Integer cargoLaneNumber;

    /**
     * 货位数量
     */
    @TableField(exist = false)
    private Integer cargoSpaceNumber;

    /**
     * 刀柜编码
     */
    private String cabCode;

    private String cabName;


    public enum CabinetType implements IEnum<Integer> {

        /**
         * 弹簧柜
         */
        spring(0,"弹簧柜"),
        /**
         * 重力柜
         */
        gravity(1,"重力柜");

        private int code;
        private String desc;

        CabinetType(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 刀柜类型
     */
    private Cabinet.CabinetType cabinetType;


    private String settledCompanyName;

    /**
     * 企业编码
     */
    private String enterpriseCode;

    /**
     * 激活码
     */
    private String activationCode;

    /**
     * 收刀柜货位集合
     */
    @TableField(exist = false)
    private List<CabinetCargoSpace> cabinetCargoSpaces = new ArrayList<>();

    /**
     * 刀柜货道集合
     */
    @TableField(exist = false)
    private List<CabinetCargoLane> cabinetCargoLanes = new ArrayList<>();
    /**
     * 车间id,sys_room_info表,房间类型为车间的房即为车间
     */
    private Long workshopId;

    /**
     * 设备编号
     */
    private String deviceNo;
}
